from http import HTTPStatus
import dashscope,config
key = config.get_key()
if key != None:    
    dashscope.api_key=key

def get_key():
    return key
'''
@author
询问ai
'''
def help(str):
    response = dashscope.Generation.call(
        model=dashscope.Generation.Models.qwen_turbo,
        prompt='用中文跟我交流：{}'.format(str)
    )
    if response.status_code == HTTPStatus.OK:
        return response.output.text  # The output text
    else:
        return response.message  # The error message.
